#pragma once

#ifndef DLL_EVENT_H
#define DLL_EVENT_H
#endif

/* Events */

class TEvent{
	int _id;
	int _x;
	int _y;
	int _src;
	char* _data;
	TEvent *_next;
	TEvent *_prev;
public:
	TEvent();
	TEvent(int Event_Id,int Event_X,int Event_Y,char* Event_Data,int Event_Source);
	~TEvent();
	int X();
	int Y();
	const char* Data();
	int Source();
	int Id();
};


static TEvent* _HEAD_EVENT	=	0;
static TEvent* _TAIL_EVENT	=	0;

static TEvent* _mCURRENTEVENT=	0;

static int _mEventStackCount=	0;
static int _mEventStackSize	=	128;
static int _mEventEnableStack=	0;

void _DeleteEvent (TEvent * ev);

void EvEmit(int Event_Id,int Event_X,int Event_Y,char* Event_Data,int Event_Source);
int EvPoll();
int EvId();
int EvX();
int EvY();
int EvSource();
const char* EvData();
void EvEnableStack(int state);
int EvStackEnabled();
void SetEvStackSize(int Size);
int EvStackSize();
int CountEv();
